Skip to content

Conversation

@neopheus
Copy link

@neopheus neopheus commented Dec 3, 2020

Fix for error on Windows
Error file moving file: mb_detect_encoding() expects parameter 1 to be string, array given

$rInput = $input;
}

return $input;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$input or $rInput?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is better code:
public function translateFromUtf8($input)
{
if ($input == null)
return $input;
if ($this->isRunningOnWindows()) {
if (is_array($input)) {
for($i = 0 ; $i < count($input);$i++)
$input[$i] = iconv('UTF-8', mb_detect_encoding($input[$i]), $input[$i]);

    } else
        $input = iconv('UTF-8', mb_detect_encoding($input), $input);
}

return $input;

}

@streamtw
Copy link
Member

Thanks for this pull request. I have merged #1260 to fix this.

@streamtw streamtw closed this Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants